#include <iostream>
using std::cout;
#include <vector>
using std::vector;

template<typename T>void printVector(const vector<T>&int2);
template<typename T>void printVectorReverse(const vector<T>&int2);
int main()
{
	const int L=6;
	int a[L]={1,2,3,4,5,6};
	vector<int>int1;

	cout<<"Lungimea initiala a lui int1 este "<<int1.size()<<" iar capacitatea este "<<int1.capacity();
	int1.push_back(2);
	int1.push_back(3);
	int1.push_back(4);
	
	cout<<"\nLungimea initiala a lui int1 este "<<int1.size()<<" iar capacitatea este "<<int1.capacity();
	
	cout<<"\n Printare vector a cu pointeri ";
	for(int *ptr=a;ptr!=a+L;ptr++)
		cout<<*ptr<<' ';
	cout<<"\n Printare cu iteratori :";
	printVector(int1);
	cout<<"\n Printare cu reverseIterator: ";
	printVectorReverse(int1);

	return 0;
}

template<typename T>void printVector(const vector<T> &int2)
	{
		typename vector<T>::const_iterator constIterat;
		
		for(constIterat=int2.begin();constIterat!=int2.end();++constIterat)
					cout<<*constIterat<<' ';
	}
template<typename T>void printVectorReverse(const vector<T> &int2)
	{
		typename vector<T>::const_reverse_iterator constIterat;
		typename vector<T>::const_reverse_iterator end=int2.rend();
		
		for(constIterat=int2.rbegin();constIterat!=end;++constIterat)
					cout<<*constIterat<<' ';
	}
